<?php

/**
 * 前台 广告服务 模块 Controller
 * ============================================================================
 * TBlog TBlog博客系统　BY Tmac PHP MVC framework
 * $Author: zwt007 $  <zwttmac@qq.com>
 * $Id: news.php 39 2011-07-11 17:12:35Z zwt007 $
 * http://www.t-mac.org；
 */
class ggfwAction extends Action
{

    private $tmp_model;
    private $show_model;
    private $article_model;
    private $index_model;
    private $difang_model;

    public function _init()
    {
        $this->assign('action', $_GET['TMAC_ACTION']);
        $this->tmp_model = Tmac::model('news');
        $this->show_model = Tmac::model('show');
        $this->index_model = Tmac::model('index');
        $this->difang_model = Tmac::model('difang');
        $this->article_model = Tmac::model('article', 'admin');        

        $username = $this->H($this->getParam('username'));
        $this->userinfo = $this->difang_model->getUserinfo($username);

        $this->config = $this->index_model->getCommon($this->userinfo);
        
        $nav_array = $this->difang_model->getCategoryArray($this->userinfo['uid'], 0);

        $hotel_list_nopage_array = $this->show_model->getHotelListNoPage($this->userinfo['uid'], 5);
        //left hotel nopage
        $news_list_nopage_array = $this->show_model->getArticleNewsListNopage(8, $this->userinfo['uid']);
        //left 会议常识
        $hycs_cid = 70;
        $hycs_list_nopage_array = $this->show_model->getArticleNewsListNopageB($hycs_cid, $this->userinfo['uid']);

        $this->assign('hotel_list_nopage_array', $hotel_list_nopage_array);
        $this->assign('news_list_nopage_array', $news_list_nopage_array);
        $this->assign('hycs_list_nopage_array', $hycs_list_nopage_array);
        $this->assign('hycs_cid', $hycs_cid);
        $this->assign('nav_array', $nav_array);
        $this->assign('userinfo', $this->userinfo);
    }

    public function index()
    {
        $cat_id = intval($this->getParam('cid'));
        $cid = empty($cat_id) ? 4 : $cat_id;
        $catinfo = $this->show_model->getCategoryInfoById($cid, $this->userinfo['uid']);
        //下级栏目
        $url = 'ggfw';
        $this->index_model->getCategoryList(4, $url, $this->userinfo['uid'], $this->userinfo['username'], $this->config['cfg_indexurl']);

        $this->assign('catinfo', $catinfo);
        $this->assign('cid', $cat_id);
        $this->V('ggfw_page');
    }

}